package com.antunnel.basicorm.web;

import java.util.Map;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.antunnel.basicorm.widget.pagination.Page;
import com.antunnel.common.util.ServletUtils;

public class BaseController
{
  protected Page page;

  public BaseController()
  {
    this.page = null;
  }

  public Map buildSearch()
  {
    Map filterParamMap = ServletUtils.getParametersStartWith(((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(), "filter", false);

    return filterParamMap;
  }

  public Page getPage() {
    return this.page;
  }

  public void setPage(Page page) {
    this.page = page;
  }
}